#!/usr/bin/env python
# encoding: utf-8
# @author: Lin Han
# @contact: voldemort22@126.com
# @file: serializers.py
# @time: 2021/12/31 上午10:48
# @desc:
from django.contrib.auth.models import User

from rest_framework import serializers


class UserSerializer(serializers.HyperlinkedModelSerializer):
    """
    新建User序列器，用户处理输入和输出的数据， 与Django的ModelForm类似
    对数据翻译转换以及验证的功能
    """

    class Meta:
        model = User
        fields = ('id', 'url', 'username', 'email', 'first_name', 'last_name', 'date_joined')
